package ca.appspace.sac.test;

import java.io.FileReader;

import ca.appspace.sac.NewLineCallback;
import ca.appspace.sac.SacParser;
import ca.appspace.sac.ValueParsedCallback;

public class SacParserTester {
	
	public static void main(String... args) throws Exception {
		SacParser parser = new SacParser();
		parser.addNewLineCallback(new NewLineCallback() {
			@Override
			public void onNewLineStarted(int lineNumber) {
				System.out.println("Parsing line "+lineNumber);
			}
		});
		parser.addValueParsedCallback(new ValueParsedCallback() {
			@Override
			public void onNewFieldParsed(int position, String value) {
				System.out.println("   Position "+position+" value "+value);
			}
		});
		parser.parse(new FileReader("/Users/eugene/Documents/workspace/sac-parser/src/ca/appspace/sac/test/test.csv"));
	}
}
